package com.mililoan.console.controller.common;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @ClassName: ErrorExceptionAction
 * @Description: 400,401等异常处理
 * @author YangChaofeng 2016年5月3日 下午2:06:26
 */
@Controller
@RequestMapping("/error")
public class ErrorExceptionAction {

	@RequestMapping(value = "/{errorCode}.do")
	public ModelAndView error(String errorCode, Model model) {
		model.addAttribute("errorCode", errorCode);
		String retUrl = "/common/error";
		if ("500".equals(errorCode)) {
			retUrl = "/common/error500";
		}
		return new ModelAndView(retUrl);
	}
}
